package org.alvin.i18n.ui;

public class Test {

    public static void main(String[] args) {
        String fileName = "example.txt";
        int dotIndex = fileName.lastIndexOf('.');
        if (dotIndex > 0 && dotIndex < fileName.length() - 1) {
            String fileExtension = fileName.substring(dotIndex );
            System.out.println("文件后缀为: " + fileExtension);
        } else {
            System.out.println("文件名格式不正确，无法获取后缀");
        }
    }
}
